/*
csyingwu
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace Kaidou.Model
{

	/// <summary>
	/// IMstHall interface for NHibernate mapped table 'mst_hall'.
	/// </summary>
	public interface IMstHall
	{
		#region Public Properties
		
		int HallSeqno
		{
			get ;
			set ;
		}
		
		short HallPrefCode
		{
			get ;
			set ;
		}
		
		int HallCode1
		{
			get ;
			set ;
		}
		
		short HallCode2
		{
			get ;
			set ;
		}
		
		string HallName
		{
			get ;
			set ;
		}
		
		string HallZipNo
		{
			get ;
			set ;
		}
		
		string HallCity
		{
			get ;
			set ;
		}
		
		string HallAddress
		{
			get ;
			set ;
		}
		
		string HallTel
		{
			get ;
			set ;
		}
		
		string UnionCode
		{
			get ;
			set ;
		}
		
		short BranchCode
		{
			get ;
			set ;
		}
		
		string CompName
		{
			get ;
			set ;
		}
		
		string DaihyoName
		{
			get ;
			set ;
		}
		
		DateTime AccessDate
		{
			get ;
			set ;
		}
		
		string HallSts
		{
			get ;
			set ;
		}
		
		DateTime RegDate
		{
			get ;
			set ;
		}
		
		DateTime UpdDate
		{
			get ;
			set ;
		}
		
		string UpdUnionCode
		{
			get ;
			set ;
		}
		
		short UpdBranchCode
		{
			get ;
			set ;
		}
		
		string UpdFuncId
		{
			get ;
			set ;
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
		#region Serialize
		/// <summary>
		/// Method for entity class serialization to XML file
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to write to. Will be overwritten if already exists.</param>
		void SerializeToFile( string pXMLFilePath );
		
		/// <summary>
		/// Method for entity class deserialization from XML file. Does not change this object content but returns another deserialized object instance
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to read from.</param>
		/// <returns>MstHall object restored from XML file</returns>
		MstHall DeserializeFromFile( string pXMLFilePath );
		
		#endregion
		
		
	}

	/// <summary>
	/// MstHall object for NHibernate mapped table 'mst_hall'.
	/// </summary>
	[Serializable]
	public class MstHall : IMstHall
	{
		#region Member Variables

		protected int _hallSeqno;
		protected short _hallPrefCode;
		protected int _hallCode1;
		protected short _hallCode2;
		protected string _hallName;
		protected string _hallZipNo;
		protected string _hallCity;
		protected string _hallAddress;
		protected string _hallTel;
		protected string _unionCode;
		protected short _branchCode;
		protected string _compName;
		protected string _daihyoName;
		protected DateTime _accessDate;
		protected string _hallSts;
		protected DateTime _regDate;
		protected DateTime _updDate;
		protected string _updUnionCode;
		protected short _updBranchCode;
		protected string _updFuncId;
		protected bool _isDeleted;
		protected bool _isChanged;
		#endregion
		
		#region Constructors
		public MstHall() {}
		
		public MstHall(int hallSeqno, short hallPrefCode, int hallCode1, short hallCode2, string hallName, string hallZipNo, string hallCity, string hallAddress, string hallTel, string unionCode, short branchCode, string compName, string daihyoName, DateTime accessDate, string hallSts, DateTime regDate, DateTime updDate, string updUnionCode, short updBranchCode, string updFuncId)
		{
			this._hallSeqno = hallSeqno; /*c*/ 
			this._hallPrefCode = hallPrefCode; /*c*/ 
			this._hallCode1 = hallCode1; /*c*/ 
			this._hallCode2 = hallCode2; /*c*/ 
			this._hallName = hallName; /*c*/ 
			this._hallZipNo = hallZipNo; /*c*/ 
			this._hallCity = hallCity; /*c*/ 
			this._hallAddress = hallAddress; /*c*/ 
			this._hallTel = hallTel; /*c*/ 
			this._unionCode = unionCode; /*c*/ 
			this._branchCode = branchCode; /*c*/ 
			this._compName = compName; /*c*/ 
			this._daihyoName = daihyoName; /*c*/ 
			this._accessDate = accessDate; /*c*/ 
			this._hallSts = hallSts; /*c*/ 
			this._regDate = regDate; /*c*/ 
			this._updDate = updDate; /*c*/ 
			this._updUnionCode = updUnionCode; /*c*/ 
			this._updBranchCode = updBranchCode; /*c*/ 
			this._updFuncId = updFuncId; /*c*/ 
		}
		
		#endregion
		
		
		
		#region Public Properties
		
		public int HallSeqno
		{
			get { return _hallSeqno; }
			set { _isChanged |= (_hallSeqno != value); _hallSeqno = value; }
		}
		
		public short HallPrefCode
		{
			get { return _hallPrefCode; }
			set { _isChanged |= (_hallPrefCode != value); _hallPrefCode = value; }
		}
		
		public int HallCode1
		{
			get { return _hallCode1; }
			set { _isChanged |= (_hallCode1 != value); _hallCode1 = value; }
		}
		
		public short HallCode2
		{
			get { return _hallCode2; }
			set { _isChanged |= (_hallCode2 != value); _hallCode2 = value; }
		}
		
		public string HallName
		{
			get { return _hallName; }
			set { _isChanged |= (_hallName != value); _hallName = value; }
		}
		
		public string HallZipNo
		{
			get { return _hallZipNo; }
			set { _isChanged |= (_hallZipNo != value); _hallZipNo = value; }
		}
		
		public string HallCity
		{
			get { return _hallCity; }
			set { _isChanged |= (_hallCity != value); _hallCity = value; }
		}
		
		public string HallAddress
		{
			get { return _hallAddress; }
			set { _isChanged |= (_hallAddress != value); _hallAddress = value; }
		}
		
		public string HallTel
		{
			get { return _hallTel; }
			set { _isChanged |= (_hallTel != value); _hallTel = value; }
		}
		
		public string UnionCode
		{
			get { return _unionCode; }
			set { _isChanged |= (_unionCode != value); _unionCode = value; }
		}
		
		public short BranchCode
		{
			get { return _branchCode; }
			set { _isChanged |= (_branchCode != value); _branchCode = value; }
		}
		
		public string CompName
		{
			get { return _compName; }
			set { _isChanged |= (_compName != value); _compName = value; }
		}
		
		public string DaihyoName
		{
			get { return _daihyoName; }
			set { _isChanged |= (_daihyoName != value); _daihyoName = value; }
		}
		
		public DateTime AccessDate
		{
			get { return _accessDate; }
			set { _isChanged |= (_accessDate != value); _accessDate = value; }
		}
		
		public string HallSts
		{
			get { return _hallSts; }
			set { _isChanged |= (_hallSts != value); _hallSts = value; }
		}
		
		public DateTime RegDate
		{
			get { return _regDate; }
			set { _isChanged |= (_regDate != value); _regDate = value; }
		}
		
		public DateTime UpdDate
		{
			get { return _updDate; }
			set { _isChanged |= (_updDate != value); _updDate = value; }
		}
		
		public string UpdUnionCode
		{
			get { return _updUnionCode; }
			set { _isChanged |= (_updUnionCode != value); _updUnionCode = value; }
		}
		
		public short UpdBranchCode
		{
			get { return _updBranchCode; }
			set { _isChanged |= (_updBranchCode != value); _updBranchCode = value; }
		}
		
		public string UpdFuncId
		{
			get { return _updFuncId; }
			set { _isChanged |= (_updFuncId != value); _updFuncId = value; }
		}
		

		public bool IsDeleted
		{
			get { return _isDeleted; }
			set { _isDeleted = value; }
		}
		
		public bool IsChanged
		{
			get { return _isChanged; }
			set { _isChanged = value; }

		}
		
		#endregion 
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			MstHall castObj = null;
			try
			{
				castObj = (MstHall)obj;
			} catch(Exception) { return false; } 
			return (castObj != null) &&
				( this._hallSeqno == castObj.HallSeqno );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _hallSeqno.GetHashCode(); /*c*/
			return hash; 
		}
		#endregion
		
		#region Serialize
		/// <summary>
		/// Method for entity class serialization to XML file
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to write to. Will be overwritten if already exists.</param>
		public virtual void SerializeToFile( string pXMLFilePath )
		{
			System.Xml.Serialization.XmlSerializer seriliaser = new System.Xml.Serialization.XmlSerializer( this.GetType() );
			using(System.IO.TextWriter txtWriter = new System.IO.StreamWriter( pXMLFilePath ))
			{
				seriliaser.Serialize(txtWriter, this);
				txtWriter.Close();
			}
		}
		/// <summary>
		/// Method for entity class deserialization from XML file. Does not change this object content but returns another deserialized object instance
		/// </summary>
		/// <param name="pXMLFilePath">Path of the XML file to read from.</param>
		/// <returns>MstHall object restored from XML file</returns>
		public virtual MstHall DeserializeFromFile( string pXMLFilePath )
		{
			MstHall _result = null;
			
			System.Xml.Serialization.XmlSerializer seriliaser = new System.Xml.Serialization.XmlSerializer( this.GetType() );
			using(System.IO.TextReader txtReader = new System.IO.StreamReader( pXMLFilePath ))
			{
				_result = (MstHall)seriliaser.Deserialize( txtReader );
				txtReader.Close();
			}
			return _result;
		}
		#endregion
		
		
	}
	
	#region Custom ICollection interface for MstHall 

	
	public interface IMstHallCollection : ICollection
	{
		MstHall this[int index]{	get; set; }
		void Add(MstHall pMstHall);
		void Clear();
	}
	
	[Serializable]
	public class MstHallCollection : IMstHallCollection
	{
		private IList<MstHall> _arrayInternal;

		public MstHallCollection()
		{
			_arrayInternal = new List<MstHall>();
		}
		
		public MstHallCollection( IList<MstHall> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<MstHall>();
			}
		}

		public MstHall this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((MstHall[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(MstHall pMstHall) { _arrayInternal.Add(pMstHall); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<MstHall> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
